package test;

import Util.javautil1;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class JDBCDemo {
    public static void main(String[] args) throws SQLException {
//        String sql="select student.sno,student.sname,student.sage,sum(grade) as sum from  sc,student where sc.sno=student.sno group by sc.sno  having sum>200";
       String sql="select sum(grade) as sum FROM\n" +
               "sc s,student stu where s.sno=stu.sno GROUP BY s.sno having sum>200";
        Object[] o={};
        ResultSet rs= javautil1.excutquery(sql,o);
        while (rs.next()){
            System.out.println("成绩为"+rs.getObject("sum"));

    }
        javautil1.close();
}

}
